class AxesController < ApplicationController

  def new
    @axis = Axis.new(:position => Axis.count + 1)
  end

  def create
    @axis = Axis.new(params[:axis])
    if @axis.save
      flash[:notice] = "Axis created"
      redirect_to edit_axis_url(@axis)
    else
      render :action => 'new'
    end
  end

  def edit
    @axis = Axis.find(params[:id])
  end

  def destroy
    Axis.destroy(params[:id])
    flash[:notice] = "axis deleted"
    redirect_to "/"
  end

end
